<?php

define ('MYPLUGIN_MIN_PHP', '5.2');
define ('MYPLUGIN_MIN_WP', '2.8');

function myplugin_activate () {
    $error = '';
    $phpversion = phpversion();
    if (version_compare (MYPLUGIN_MIN_PHP, $phpversion, '>'))
        $error .= sprintf ("Minimum PHP version required is %s, not %s.\n", MYPLUGIN_MIN_PHP, $phpversion);
    $wpversion = get_bloginfo('version');
    if (version_compare (MYPLUGIN_MIN_WP, $wpversion, '>'))
        $error .= sprintf ("Minimum WP version required is %s, not %s.\n", MYPLUGIN_MIN_WP, $wpversion);
    if (!$error) return;
    deactivate_plugins (__FILE__);
    die ($error);
}
register_activation_hook (__FILE__, 'myplugin_activate');

?>
